package com.ruoyi.plasma.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.plasma.domain.宣传员费用登记表;
import com.ruoyi.plasma.service.I宣传员费用登记表Service;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 宣传员费用登记表Controller
 * 
 * @author ruoyi
 * @date 2024-09-19
 */
@RestController
@RequestMapping("/plasma/expenseRegistration")
public class 宣传员费用登记表Controller extends BaseController
{
    @Autowired
    private I宣传员费用登记表Service 宣传员费用登记表Service;

    /**
     * 查询宣传员费用登记表列表
     */
    @PreAuthorize("@ss.hasPermi('plasma:expenseRegistration:list')")
    @GetMapping("/list")
    public TableDataInfo list(宣传员费用登记表 宣传员费用登记表)
    {
        startPage();
        List<宣传员费用登记表> list = 宣传员费用登记表Service.select宣传员费用登记表List(宣传员费用登记表);
        return getDataTable(list);
    }

    /**
     * 导出宣传员费用登记表列表
     */
    @PreAuthorize("@ss.hasPermi('plasma:expenseRegistration:export')")
    @Log(title = "宣传员费用登记表", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, 宣传员费用登记表 宣传员费用登记表)
    {
        List<宣传员费用登记表> list = 宣传员费用登记表Service.select宣传员费用登记表List(宣传员费用登记表);
        ExcelUtil<宣传员费用登记表> util = new ExcelUtil<宣传员费用登记表>(宣传员费用登记表.class);
        util.exportExcel(response, list, "宣传员费用登记表数据");
    }

    /**
     * 获取宣传员费用登记表详细信息
     */
    @PreAuthorize("@ss.hasPermi('plasma:expenseRegistration:query')")
    @GetMapping(value = "/{序号}")
    public AjaxResult getInfo(@PathVariable("序号") Long 序号)
    {
        return success(宣传员费用登记表Service.select宣传员费用登记表By序号(序号));
    }

    /**
     * 新增宣传员费用登记表
     */
    @PreAuthorize("@ss.hasPermi('plasma:expenseRegistration:add')")
    @Log(title = "宣传员费用登记表", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody 宣传员费用登记表 宣传员费用登记表)
    {
        return toAjax(宣传员费用登记表Service.insert宣传员费用登记表(宣传员费用登记表));
    }

    /**
     * 修改宣传员费用登记表
     */
    @PreAuthorize("@ss.hasPermi('plasma:expenseRegistration:edit')")
    @Log(title = "宣传员费用登记表", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody 宣传员费用登记表 宣传员费用登记表)
    {
        return toAjax(宣传员费用登记表Service.update宣传员费用登记表(宣传员费用登记表));
    }

    /**
     * 删除宣传员费用登记表
     */
    @PreAuthorize("@ss.hasPermi('plasma:expenseRegistration:remove')")
    @Log(title = "宣传员费用登记表", businessType = BusinessType.DELETE)
	@DeleteMapping("/{序号s}")
    public AjaxResult remove(@PathVariable Long[] 序号s)
    {
        return toAjax(宣传员费用登记表Service.delete宣传员费用登记表By序号s(序号s));
    }
}
